import base from './base'
import axios from './http'
import qs from 'qs'         // qs.stringify(params)
const shopping = {
    slidesIndex(params) {        
        return axios.post(`${base.sq}slides/index`, params)       // 首页轮播
    },
    goodsCategory(params) {        
        return axios.post(`${base.sq}goods/category`, params)       // 首页商品分类
    },
    goodsIndex(params) {        
        return axios.post(`${base.sq}goods/index`, params)         // 首页商品列表
    },
    goodsDetail(params) {        
        return axios.post(`${base.sq}goods/detail`, params)         // 商品详情
    },
    cartAdd(params) {        
        return axios.post(`${base.sq}cart/add`, params)         // 添加到购物车
    },
    cartgetCartProNum(params) {        
        return axios.post(`${base.sq}cart/getCartProNum`, params)         // 购物车中商品总数量
    },
    cartIndex(params) {        
        return axios.post(`${base.sq}cart/index`, params)         // 购物车列表
    },
    cartDelete(params) {        
        return axios.post(`${base.sq}cart/delete`, params)         // 购物车删除
    },
    cartUpCart(params) {        
        return axios.post(`${base.sq}cart/up_cart`, params)         // 更新购物车
    },
    orderBuyShow(params) {        
        return axios.post(`${base.sq}order/buyShow`, params)         // 购物车下单前显示界面数据
    },
    addressIndex(params) {        
        return axios.post(`${base.sq}Address/index`, params)         // 地址列表
    },
    addAddress(params) {        
        return axios.post(`${base.sq}Address/add_addr`, params)         // 添加地址
    },
    addSertDefault(params) {        
        return axios.post(`${base.sq}Address/set_default`, params)         // 设置默认地址
    },
    addDeladdr(params) {        
        return axios.post(`${base.sq}Address/del_addr`, params)         // 删除地址
    },
    userGetInfo(params) {        
        return axios.post(`${base.sq}user/getPatientInfo`, params)         // 患者个人信息
    },
    orderGetUnm(params) {        
        return axios.post(`${base.sq}order/getOrdCntForStatus`, params)         // 获取订单的数量
    },
    userGetDietitian(params) {        
        return axios.post(`${base.sq}user/getDietitianInfo`, params)         // 获取营养师信息
    },
    orderGoodsAddOrder(params) {        
        return axios.post(`${base.sq}order/goodsAddOrder`, params)         // 立即购买下单
    },
    orderCartAddOrder(params) {        
        return axios.post(`${base.sq}order/cartAddOrder`, params)         // 购物车购买下单
    },
    orderGetJsApiParam(params) {        
        return axios.post(`${base.sq}order/getJsApiParam`, params)         // 微信下单
    },
    orderIndex(params) {        
        return axios.post(`${base.sq}order/index`, params)         // 订单状态
    },
    orderDetails(params) {        
        return axios.post(`${base.sq}order/orderDetails`, params)         // 订单详情
    },
    orderEdit(params) {        
        return axios.post(`${base.sq}order/orderEdit`, params)         // 取消订单
    },
}
export default shopping